 package voxietest1.jam;

import processing.core.PMatrix;
import processing.core.PVector;
import voxbox.wrapper.VoxiScene;

public class BoxesScene extends VoxiScene {
	public BoxesScene() {
	}

	Player[] players = new Player[4]; 
	
	// z = {-.6, .6}
	
	public void mySetup() {
		players[0] = new Player(-1,-1,-.60f);
		players[0].setVelocity(0, 0, 1f);
		
		players[1] = new Player(.5f,.5f,-.20f);
		players[1].setVelocity(0,0,-.5f);
		
		players[2] = new Player(0,0,.20f);
		players[2].setVelocity(1f,-.5f,0f);
		
		players[3] = new Player(0,0,.60f);
		players[3].setVelocity(-1f,-1f,0f);
	}

	public void myUpdate() {
		for (Player p : players) {
			p.Update((float)deltaTime);
		}
	}

	
	
	public void myDrawTwist() {		
		float twist = scene.mouseX/400.0f;
		
		for (int i=0; i < 40; i++) {
			scene.drawBox(0,0,-1+.05f*i, i*twist, .5f, .5f);
		}
	}
	
		
	public void myDraw() {
		for (Player p : players) {
			scene.drawBox(p.x, p.y, p.z, 0, p.width, p.height);
		}
		
	}
}
